package global

import (
	"flag"
	"fmt"
	"git.supremind.info/product/box/sdk/util"
	"git.supremind.info/product/box/vehicle/config"
)

const (
	logPath = "/var/log/web"
	dbPath  = "/home/supre_edge/data/box-app-api1.db"
)

var (
	Env             string
	ServerSetting   *config.ServerSettings
	VmrSetting      *config.VmrSettings
	AppSetting      *config.AppSettings
	DatabaseSetting *config.DatabaseSettings
	LogSavePath     string //对外
	DBPath          string //对外
)

func InitConfig() {
	fmt.Println("------------------ main init ------------------")
	a := util.IsPing("100.100.69.106")
	fmt.Println(a)

	// 开发时在idea替换下自己的路径
	logPath := flag.String("log_path", logPath, "Use -log_path <log_path>")
	dbPath := flag.String("db_path", dbPath, "Use -db_path <db_path>")
	flag.Parse()

	LogSavePath = *logPath
	DBPath = *dbPath

	fmt.Println("logPath:", LogSavePath, ",dbPath:", DBPath)
}
